package org.adl.registry.types;

import java.util.ArrayList;

/**
 * Abstract definition of base methods associated with a RimParameter.
 * @author Jacob Marks - Joint ADL Co-Lab
 * @version 1.0
 * @license This software is licensed as open source software pursuant to the terms defined in the Joint ADL Co-Lab Open Source Software License.  Use of any part of this software constitutes acceptance of this license. The Joint ADL Co-Lab open source agreement is available at {@link http://adlregistry.adlnet.gov/source_license.html}.
 */
public abstract class RimParameter
{
    private String mOrigionalValue;
    private String mParameterName;
    private String mParameterValue;
    private ArrayList<String> mValidationErrors;
    
    /**
     * Creates a new instance of RimParameter
     */
    public RimParameter()
    {
        this.mValidationErrors = new ArrayList<String>();
    }
    
    /**
     * Creates a new instance of RimParameter
     */
    public RimParameter(String iParameterName, String iParameterValue)
    {
        this.mParameterName = iParameterName;
        this.setOrigionalValue(iParameterValue);
    }
    
    public String getParameterName()
    {
        return this.mParameterName;
    }
    
    public void setParameterName(String iParameterName)
    {
        this.mParameterName = iParameterName;
    }
    
    public String getParameterValue()
    {
        return this.mParameterValue;
    }
    
    public void setParameterValue(String iParameterValue)
    {
        this.mParameterValue = iParameterValue;
    }
    
    public ArrayList<String> getValidaionErrors()
    {
        return this.mValidationErrors;
    }
    
    public boolean isParameterValueValid()
    {
        return (this.mValidationErrors.size() == 0);
    }
    
    public String getOrigionalValue()
    {
        return this.mOrigionalValue;
    }
    
    public void setOrigionalValue(String iOrigionalValue)
    {
        this.mOrigionalValue = iOrigionalValue;
        this.mParameterValue = iOrigionalValue;
    }
    
    protected abstract void validate();
}
